Skip to content

fix: pass kubernetesPath into the mustache path context - #302

Merged
aviadhahami merged 1 commit into
nodevault:masterfrom
emmayusufu:fix/kubernetes-path-mustache-context
Oct 11, 2026
Merged

aviadhahami merged 1 commit into
nodevault:masterfrom
emmayusufu:fix/kubernetes-path-mustache-context

Conversation

@emmayusufu

Copy link
Copy Markdown
Contributor

Closes #300.

The kubernetes command paths use /auth/{{mount_point}}{{^mount_point}}{{kubernetesPath}}{{/mount_point}}/login, so when no mount_point is passed they fall back to {{kubernetesPath}}. But kubernetesPath only exists on the client object (client.kubernetesPath, defaulted to 'kubernetes' in src/index.js) and was never added to the mustache render context, which only received the call args. So the fallback rendered empty and kubernetesLogin() hit /auth//login instead of /auth/kubernetes/login.

The fix injects client.kubernetesPath into the render context, with call args still taking precedence so a per-call override keeps working. This also covers the other kubernetes role command paths that use the same template.

Added two unit tests (default mount point, and a custom kubernetesPath). Both fail on the old code with /auth//login and pass with the fix. Full unit suite: 99 passing, lint clean.

The kubernetes command paths fall back to {{kubernetesPath}} when no
mount_point is given, but kubernetesPath only lives on the client and
was never added to the mustache render context, so the templates
rendered an empty segment (e.g. kubernetesLogin hit /auth//login
instead of /auth/kubernetes/login).

Inject client.kubernetesPath into the render context; per-call args
still take precedence. Adds unit tests for the default and a custom
kubernetesPath.

Closes nodevault#300
@emmayusufu

Copy link
Copy Markdown
Contributor Author

Just a gentle check-in on this one. It's a small fix so kubernetesPath gets passed into the mustache path context. Happy to rebase or add a test if that would help it along. Thanks for maintaining node-vault.

@aviadhahami
aviadhahami added this pull request to the merge queue Oct 11, 2026
@aviadhahami

Copy link
Copy Markdown
Collaborator

Thanks for your contribution! Approving

Merged via the queue into nodevault:master with commit 80429a5 Oct 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: kubernetesLogin uses {{kubernetesPath}} mustache variable but it's not passed, causing /auth//login path in v0.10.10

2 participants